<%@page import="com.wef.demo.entity.domain.StudentSubjectDomain"%>
<%@page import="com.wef.demo.entity.domain.StudentDomain"%>
<%@page import="com.wef.demo.entity.domain.ClazzDomain"%>
<%@page import="com.wef.demo.entity.domain.SubjectDomain"%>
<%@page import="com.gfa4j.resource.ResourceManagerServer"%>
<%@page import="com.wef.common.util.CommonMessageDomain"%>
<%@page import="com.gfa4j.query.Field"%>
<%@ include file="/pages/common/taglib.jsp"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
		<k:jqgrid 
			queryObjectName="<%=StudentSubjectDomain.StudentSubject%>"
		 	jsonReader="{id:'studentSubjectId'}"
		 	colModel="[{name:'studentSubjectId',hidden:true},
		 		{label:'demo.StudentSubject.subjectCode',name:'subjectCode'},
		 		{label:'demo.StudentSubject.subjectName',name:'subjectName'}]"
			id="tableStudentSubject"
		 	newBtnId="newBtnStudentSubject"
		 	saveBtnId="saveBtnStudentSubject"
		 	cancelBtnId="cancelBtnStudentSubject"
		 	deleteBtnId="deleteBtnStudentSubject"
		 	editFormId="editFormStudentSubject"
		 	serviceMethodName="saveOrUpdateStudentSubjects"
		 	serviceName="StudentSubjectService"
		 	setQueryInfo="setQueryInfo4StudentSubject"
		 	enabledLoad="false"
		 	beforeSave="beforeSave4StudentSubject"
		 	beforeNew="beforeNew4Student"
		 	/>
		 	
		<k:autoSelectConfig 
			url="${ctx}" 
			id="editSubjectName" 
			width="350" 
			autoFill="editSubjectName|{subjectName},editSubjectCode|{subjectCode}" 
			displayField="subjectName,subjectCode" 
			className="com.wef.demo.entity.Subject" 
			displayFieldI18n="demo.Subject.subjectName,demo.Subject.subjectCode" 
			displayNum="8"
			canNotInput="true"
			/>
			
		<script type="text/javascript">
			$(window).ready(function(){
// 				alert("item2");
// 				$('div[accordion=true]').accordion({collapsible : true});
// 				$('div[tabGroup=true]').tabs();

				//打开弹出层
				$("#dialog_demo_tab_load2_edit_item2").dialog($.extend({},$.ui.dialogDefaultConfig,{
					modal:true,
					resizable:true,
					minHeight:350,
					minWidth:600,
					width:600,
					height:360,
					autoOpen:false,
					buttons:[{
						"text":i18n.global.close,
						"click":function(){
							$(this).dialog("close");
						}
					}]
				})).bind("dialogopen",function(){
					//弹出层中有grid需调用重置宽度(弹出层上的grid 要小于弹出层50的宽度)
					$('#tableStudentSubject').jqGrid("resetGridWidth",true,550);
				}).dialog("open");
			});
		</script>
				
<!-- 		<div id="tabItem3"> -->
				<div id=dialog_demo_tab_load2_edit_item2 title="<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_EDIT)%>" style="display: none;">
					<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
						<ul class="button_box">
							<li>
								<k:button styleId="newBtnStudentSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_NEW%>"/>
							</li>
							<li>
								<k:button styleId="saveBtnStudentSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_SAVE%>"/>
							</li>
							<li>
								<k:button styleId="cancelBtnStudentSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_CANCEL%>"/>
							</li>
							<li>
								<k:button styleId="deleteBtnStudentSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_DELETE%>"/>
							</li>
						</ul>
					</div>
					
					<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
						<div>
							<table id="tableStudentSubject"></table>
						</div>
					</div>
					
					<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
						<form id="editFormStudentSubject" name="editFormStudentSubject">
							<ul id="editUlStudentSubject" allowChange="true" class="edit_box">
								<k:hidden property="studentSubjectId" styleId="editStudentSubjectId"/>
								<li>
									<k:label text="demo.StudentSubject.subjectCode" allowBlank="false"/>
									<k:text property="subjectCode" styleId="editSubjectCode" styleClass="text" readonly="true" validateRules="{required:true}"/>
								</li>
								<li>
									<k:label text="demo.StudentSubject.subjectName" allowBlank="false"/>
									<k:autoSelect property="subjectName" styleId="editSubjectName" styleClass="text" validateRules="{required:true}"/>
								</li>
							</ul>
						</form>
					</div>
					
				</div>
<!-- 		</div> -->